home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume8 / dca2troff < prev    next >
Encoding:
Internet Message Format  |  1987-02-18  |  49.3 KB

  1. Subject:  v08i075:  Convert IBM DCA documents to troff input
  2. Newsgroups: mod.sources
  3. Approved: mirror!rs
  4.  
  5. Submitted by: cca!harvard!harvisr!sob
  6. Mod.sources: Volume 8, Issue 75
  7. Archive-name: dca2troff
  8.  
  9. [  I don't have any DCA documents, and would just as soon keep it
  10.    that way... --r$  ]
  11.  
  12. #! /bin/sh
  13. # This is a shell archive, meaning:
  14. # 1. Remove everything above the #! /bin/sh line.
  15. # 2. Save the resulting text in a file.
  16. # 3. Execute the file with /bin/sh (not csh) to create the files:
  17. #     README Makefile dca2troff.1 dca2troff.h ebtab.h dca2troff.c
  18. #     do_accent.c do_mbd1.c do_mbd2.c do_mbd4.c do_mbd8.c do_mbd9.c
  19. #     do_multi.c do_sce4.c do_sfe1.c do_sfe2.c do_sfe3.c do_sfe4.c
  20. #     do_sfe5.c do_sfe6.c do_sfe8.c do_sfe9.c do_single.c do_spchar.c
  21. #     do_text.c externs.c getopt.c misc.c outachar.c opts
  22. export PATH; PATH=/bin:$PATH
  23. echo shar: extracting "'README'" '(1160 characters)'
  24. if test -f 'README'
  25. then
  26.     echo shar: will not over-write existing file "'README'"
  27. else
  28. sed 's/^    X//' << \SHAR_EOF > 'README'
  29.     XThis program is mostly the result of a hard weekend's work.  Some
  30.     Xpeople came to me with something that needed to be printed in time for
  31.     Xthe 350th celebration of Harvard. This was on a friday and the printer's
  32.     Xdeadline was tuesday. So this program is targeted to the requirements
  33.     Xof this specific text.
  34.     X
  35.     XNote also that I am a manager and instructor ( those that can't do -
  36.     Xteach ) and not a programmer so this is weak C and has only been tested
  37.     Xunder 4.3BSD but should be portable.
  38.     X
  39.     XA DCA input document will be turned into useful troff but most page
  40.     Xsetups will be lost.  All "required carrier returns", centering
  41.     Xforced page ends etc will be reflected in the troff output, but margins
  42.     Xand the like will not be. 
  43.     X
  44.     XUnderlineing is turned into italic, and font changes try to do the right
  45.     Xthing. Troff comment lines are insterted for many "interesting" DCA
  46.     Xcommands.
  47.     X
  48.     XThe file "opts" is what I would do if I had the time.
  49.     X
  50.     XYou may want to do some local mods in the files do_spchar.c and 
  51.     Xdo_accent.c, they are set up for our imagen fonts.
  52.     X
  53.     Xplease send me any bugs/fixes/updates
  54.     X
  55.     XScott Bradner
  56.     XHarvard University
  57.     Xsob@harvard.{uucp,csnet,arpa,bitnet,harvard.edu}
  58. SHAR_EOF
  59. if test 1160 -ne "`wc -c < 'README'`"
  60. then
  61.     echo shar: error transmitting "'README'" '(should have been 1160 characters)'
  62. fi
  63. chmod +x 'README'
  64. fi # end of overwriting check
  65. echo shar: extracting "'Makefile'" '(441 characters)'
  66. if test -f 'Makefile'
  67. then
  68.     echo shar: will not over-write existing file "'Makefile'"
  69. else
  70. sed 's/^    X//' << \SHAR_EOF > 'Makefile'
  71.     XCFLAGS = -g
  72.     X
  73.     XOBJS = dca2troff.o do_sfe1.o do_sfe2.o do_sfe3.o do_sfe4.o do_sfe5.o \
  74.     X    do_sfe6.o do_sfe8.o do_sfe9.o do_text.o do_single.o \
  75.     X    do_multi.o do_mbd1.o do_mbd2.o do_mbd4.o do_mbd8.o do_mbd9.o \
  76.     X    misc.o externs.o outachar.o do_accent.o do_spchar.o
  77.     X
  78.     Xdca2troff:    ${OBJS}
  79.     X    ${CC} -o dca2troff ${OBJS}
  80.     X
  81.     X${OBJS}: dca2troff.h
  82.     X
  83.     Xdo_text.o: ebtab.h
  84.     X
  85.     Xclean:
  86.     X    /bin/rm -f ${OBJS} dca2troff
  87.     X
  88.     Xinstall: dca2troff
  89.     X    install -s dca2troff /usr/local/bin
  90. SHAR_EOF
  91. if test 441 -ne "`wc -c < 'Makefile'`"
  92. then
  93.     echo shar: error transmitting "'Makefile'" '(should have been 441 characters)'
  94. fi
  95. chmod +x 'Makefile'
  96. fi # end of overwriting check
  97. echo shar: extracting "'dca2troff.1'" '(1048 characters)'
  98. if test -f 'dca2troff.1'
  99. then
  100.     echo shar: will not over-write existing file "'dca2troff.1'"
  101. else
  102. sed 's/^    X//' << \SHAR_EOF > 'dca2troff.1'
  103.     X.TH NAME SECTION local
  104.     X.SH NAME
  105.     Xdca2troff  \- convert Document Content Architecture documents to troff
  106.     X.SH SYNOPSIS
  107.     X.B dca2troff < file
  108.     X.SH DESCRIPTION
  109.     X.B dca2troff
  110.     Xreads IBM Document Content Architecture (
  111.     X.B DCA
  112.     X) documents in Revisable-Form
  113.     XText (
  114.     X.B RFT
  115.     X) format.
  116.     XOnly a few of the many
  117.     X.B RFT
  118.     Xcommands (
  119.     X.I Structured Text, Multibyte and One-Byte
  120.     X) are implemented.  The program does parse the commands and
  121.     Xwill print out warnings for any unknown commands.  Troff form
  122.     Xcomments are insterted in the output text stream for some of the
  123.     Xuseful commands like font change requests.
  124.     X.SH FILES
  125.     X.SH SEE ALSO
  126.     XIBM document - Document Content Architecture: Revisable-Form
  127.     XText Reference ( part # SC23-0758-0 ).
  128.     X.SH DIAGNOSTICS
  129.     X.SH BUGS
  130.     XThe version of the RFT manual I used was the first edition ( june 1983 ).
  131.     XI found at least two very common commands that Display Write 3 uses are
  132.     Xnot in the manual,
  133.     X.I dca2troff
  134.     Xnow ignores them.
  135.     X.br
  136.     XBiggest bug: DCA-RFT files are in EBCDIC.
  137.     X.SH AUTHOR
  138.     XScott Bradner ( sob@harvard.{arpa,csnet,uucp,bitnet,harvard.edu}
  139. SHAR_EOF
  140. if test 1048 -ne "`wc -c < 'dca2troff.1'`"
  141. then
  142.     echo shar: error transmitting "'dca2troff.1'" '(should have been 1048 characters)'
  143. fi
  144. chmod +x 'dca2troff.1'
  145. fi # end of overwriting check
  146. echo shar: extracting "'dca2troff.h'" '(1214 characters)'
  147. if test -f 'dca2troff.h'
  148. then
  149.     echo shar: will not over-write existing file "'dca2troff.h'"
  150. else
  151. sed 's/^    X//' << \SHAR_EOF > 'dca2troff.h'
  152.     X#include <stdio.h>
  153.     X
  154.     Xextern int in_fcr;        /* if CRE and in_fcr, then required return */
  155.     Xextern int in_it;        /* in an indent tab */
  156.     X
  157.     Xextern int sf_length;        /* length of structured field */
  158.     Xextern int sf_class;        /* class of structured field */
  159.     Xextern int sf_type;        /* type of structured field */
  160.     Xextern int sf_format;        /* format of structured field */
  161.     X
  162.     Xextern int mb_class;        /* class of a multi byte command */
  163.     Xextern int mb_count;        /* size of a multi byte command */
  164.     Xextern int mb_type;        /* type of a multi byte command */
  165.     X
  166.     Xextern int blpt;        /* pointer into output buffer */
  167.     Xextern char bufline[];        /* output buffer */
  168.     X
  169.     Xextern int sf_incnt;        /* how many chars have we read in this sf */
  170.     X
  171.     Xextern char ctemp;        /* some temp regs */
  172.     Xextern char dtemp;        /* some temp regs */
  173.     Xextern char etemp;        /* some temp regs */
  174.     Xextern char ftemp;        /* some temp regs */
  175.     Xextern char gtemp;        /* some temp regs */
  176.     Xextern char htemp;        /* some temp regs */
  177.     X
  178.     Xextern int itemp;        /* some temp regs */
  179.     Xextern int jtemp;        /* some temp regs */
  180.     Xextern int ktemp;        /* some temp regs */
  181.     Xextern int ltemp;        /* some temp regs */
  182.     Xextern int mtemp;        /* some temp regs */
  183.     Xextern int ntemp;        /* some temp regs */
  184.     X
  185.     Xextern char tline[];        /* a temp buffer */
  186. SHAR_EOF
  187. if test 1214 -ne "`wc -c < 'dca2troff.h'`"
  188. then
  189.     echo shar: error transmitting "'dca2troff.h'" '(should have been 1214 characters)'
  190. fi
  191. chmod +x 'dca2troff.h'
  192. fi # end of overwriting check
  193. echo shar: extracting "'ebtab.h'" '(8517 characters)'
  194. if test -f 'ebtab.h'
  195. then
  196.     echo shar: will not over-write existing file "'ebtab.h'"
  197. else
  198. sed 's/^    X//' << \SHAR_EOF > 'ebtab.h'
  199.     X/* table of EBCDIC characters                *
  200.     X * 1st entry is character use type            *
  201.     X *    0    forget it                *
  202.     X *    1    simple translate to string        *
  203.     X *    2    single byte control            *
  204.     X *    3    "csp" for multibyte control        *
  205.     X *    4    accented character            *
  206.     X *    5    troff special character            *
  207.     X *    6    non-troff special character        *
  208.     X *                            *
  209.     X * 2nd entry is a string, use depends on type        *
  210.     X *      1    string to output            *
  211.     X *    2    unused                    *
  212.     X *    3    unused                    *
  213.     X *    4    accent <SPACE> character        *
  214.     X *    5    string to output            *
  215.     X *    6    if string then output            *
  216.     X *        if no string ( NULL ) then special    *
  217.     X *        character local processing required    *
  218.     X *                            */
  219.     X
  220.     Xstruct echar {
  221.     X    int type;
  222.     X    char *arg;
  223.     X} ebaray[] = {
  224.     X        0, "",        /* 0x00 - NULL */
  225.     X        0, "",        /* 0x01 - xx*/
  226.     X        0, "",        /* 0x02 - xx*/
  227.     X        0, "",        /* 0x03 - xx*/
  228.     X        0, "",        /* 0x04 - xx*/
  229.     X        2, "\t",    /* 0x05 - horizontal tab */
  230.     X        2, "\n.br\n",    /* 0x06 - required carrier return */
  231.     X        0, "",        /* 0x07 - xx*/
  232.     X        0, "",        /* 0x08 - xx*/
  233.     X        2, "\u",    /* 0x09 - superscript */
  234.     X        0, "",        /* 0x0a - xx*/
  235.     X        0, "",        /* 0x0b - xx*/
  236.     X        2, "\n",    /* 0x0c - page end */
  237.     X        2, "\n",    /* 0x0d - zero index carrier return */
  238.     X        0, "",        /* 0x0e - xx*/
  239.     X        0, "",        /* 0x0f - xx*/
  240.     X        0, "",        /* 0x10 - xx*/
  241.     X        0, "",        /* 0x11 - xx*/
  242.     X        0, "",        /* 0x12 - xx*/
  243.     X        0, "",        /* 0x13 - xx*/
  244.     X        0, "",        /* 0x14 - xx*/
  245.     X        2, "\n",    /* 0x15 - carrier return*/
  246.     X        2, "\b",    /* 0x16 - backspace */
  247.     X        0, "",        /* 0x17 - xx*/
  248.     X        0, "",        /* 0x18 - xx*/
  249.     X        0, "",        /* 0x19 - xx*/
  250.     X        2, "",        /* 0x1a - unit backspace */
  251.     X        0, "",        /* 0x1b - xx*/
  252.     X        0, "",        /* 0x1c - xx*/
  253.     X        0, "",        /* 0x1d - xx*/
  254.     X        0, "",        /* 0x1e - xx*/
  255.     X        0, "",        /* 0x1f - xx*/
  256.     X        0, "",        /* 0x20 - xx*/
  257.     X        0, "",        /* 0x21 - xx*/
  258.     X        0, "",        /* 0x22 - xx*/
  259.     X        2, "",        /* 0x23 - word underscore */
  260.     X        0, "",        /* 0x24 - xx*/
  261.     X        2, "",        /* 0x25 - index */
  262.     X        0, "",        /* 0x26 - xx*/
  263.     X        0, "",        /* 0x27 - xx*/
  264.     X        0, "",        /* 0x28 - xx*/
  265.     X        0, "",        /* 0x29 - xx*/
  266.     X        0, "",        /* 0x2a - xx*/
  267.     X        3, "",        /* 0x2b - CSP */
  268.     X        0, "",        /* 0x2c - xx*/
  269.     X        0, "",        /* 0x2d - xx*/
  270.     X        0, "",        /* 0x2e - xx*/
  271.     X        0, "",        /* 0x2f - xx*/
  272.     X        0, "",        /* 0x30 - xx*/
  273.     X        0, "",        /* 0x31 - xx*/
  274.     X        0, "",        /* 0x32 - xx*/
  275.     X        2, "",        /* 0x33 - index return */
  276.     X        0, "",        /* 0x34 - xx*/
  277.     X        0, "",        /* 0x35 - xx*/
  278.     X        2, "\\h'-\\w'1'u'",    /* 0x36 - numeric backspace */
  279.     X        0, "",        /* 0x37 - xx*/
  280.     X        2, "\d",    /* 0x38 - subscript */
  281.     X        2, "",        /* 0x39 - indent tab */
  282.     X        2, "\n.bp\n",    /* 0x3a - required page end */
  283.     X        0, "",        /* 0x3b - xx*/
  284.     X        0, "",        /* 0x3c - xx*/
  285.     X        0, "",        /* 0x3d - xx*/
  286.     X        0, "",        /* 0x3e - xx*/
  287.     X        2, "",        /* 0x3f - substitute */
  288.     X        2, " ",        /* 0x40 - space */
  289.     X        2, " ",        /* 0x41 - required space */
  290.     X        4, "^ a",    /* 0x42 - a circumflex */
  291.     X        4, ".. a",    /* 0x43 - a diaeresis */
  292.     X        4, "' a",    /* 0x44 - a grave */
  293.     X        4, "` a",    /* 0x45 - a acute */
  294.     X        4, "~ a",    /* 0x46 - a tilde */
  295.     X        4, "de a",    /* 0x47 - a angstrom */
  296.     X        4, "cd c",    /* 0x48 - c cedilla */
  297.     X        4, "~ n",    /* 0x49 - n telde */
  298.     X        1, "[",        /* 0x4a - [ */
  299.     X        1, ".",        /* 0x4b - . */
  300.     X        1, "<",        /* 0x4c - < */
  301.     X        1, "(",        /* 0x4d - ( */
  302.     X        1, "+",        /* 0x4e - + */
  303.     X        1, "!",        /* 0x4f - ! */
  304.     X        1, "&",        /* 0x50 - & */
  305.     X        4, "` e",    /* 0x51 - e acute */
  306.     X        4, "^ e",    /* 0x52 - e circumflex */
  307.     X        4, ".. e",    /* 0x53 - e diaeresis */
  308.     X        4, "' e",    /* 0x54 - e grave */
  309.     X        4, "` i",    /* 0x55 - i acute */
  310.     X        4, "^ i",    /* 0x56 - i circumflex */
  311.     X        4, ".. i",    /* 0x57 - i diaeresis */
  312.     X        4, "' i",    /* 0x58 - i grave */
  313.     X        6, "\\(ss",    /* 0x59 - german sharp s */
  314.     X        1, "]",        /* 0x5a - ] */
  315.     X        1, "$",        /* 0x5b - $ */
  316.     X        1, "*",        /* 0x5c - * */
  317.     X        1, ")",        /* 0x5d - ) */
  318.     X        1, ";",        /* 0x5e - ; */
  319.     X        1, "^",        /* 0x5f - ^ */
  320.     X        2, "-",        /* 0x60 - required - */
  321.     X        1, "/",        /* 0x61 - / */
  322.     X        4, "^ A",    /* 0x62 - A circumflex */
  323.     X        4, ".. A",    /* 0x63 - A diaeresis */
  324.     X        4, "' A",    /* 0x64 - A grave */
  325.     X        4, "` A",    /* 0x65 - A acute */
  326.     X        4, "~ A",    /* 0x66 - A tilde */
  327.     X        4, "de A",    /* 0x67 - A angstrom */
  328.     X        4, "cd C",    /* 0x68 - C cedilla */
  329.     X        4, "~ N",    /* 0x69 - N tilde */
  330.     X        1, "|",        /* 0x6a - | */
  331.     X        1, ",",        /* 0x6b - , */
  332.     X        1, "%",        /* 0x6c - % */
  333.     X        1, "_",        /* 0x6d - _ */
  334.     X        1, ">",        /* 0x6e - > */
  335.     X        1, "?",        /* 0x6f - ? */
  336.     X        6, "\\(O/",    /* 0x70 - O slash */
  337.     X        4, "' E",    /* 0x71 - E acute */
  338.     X        4, "^ E",    /* 0x72 - E circumflex */
  339.     X        4, ".. E",    /* 0x73 - E diaresis */
  340.     X        4, "` E",    /* 0x74 - E grave */
  341.     X        4, "' I",    /* 0x75 - I acute */
  342.     X        4, "^ I",    /* 0x76 - I circumflex */
  343.     X        4, ".. I",    /* 0x77 - I diaresis */
  344.     X        4, "` I",    /* 0x78 - I grave */
  345.     X        5, "\(ag",    /* 0x79 - grave */
  346.     X        1, ":",        /* 0x7a - : */
  347.     X        1, "#",        /* 0x7b - # */
  348.     X        1, "@",        /* 0x7c - @ */
  349.     X        1, "\'",    /* 0x7d - ' */
  350.     X        1, "=",        /* 0x7e - = */
  351.     X        1, "\"",     /* 0x7f - " */
  352.     X        1, "/",        /* 0x80 - / */
  353.     X        1, "a",        /* 0x81 - a */
  354.     X        1, "b",        /* 0x82 - b */
  355.     X        1, "c",        /* 0x83 - c */
  356.     X        1, "d",        /* 0x84 - d */
  357.     X        1, "e",        /* 0x85 - e */
  358.     X        1, "f",        /* 0x86 - f */
  359.     X        1, "g",        /* 0x87 - g */
  360.     X        1, "h",        /* 0x88 - h */
  361.     X        1, "i",        /* 0x89 - i */
  362.     X        6, "",        /* 0x8a - European open quote */
  363.     X        6, "",        /* 0x8b - European close quote */
  364.     X        6, "",        /* 0x8c - d stroke */
  365.     X        4, "` y",    /* 0x8d - y acute */
  366.     X        6, "",        /* 0x8e - small letter thorn */
  367.     X        5, "\\(+-",    /* 0x8f - +- */
  368.     X        5, "\\(de",    /* 0x90 - degree */
  369.     X        1, "j",        /* 0x91 - j */
  370.     X        1, "k",        /* 0x92 - k */
  371.     X        1, "l",        /* 0x93 - l */
  372.     X        1, "m",        /* 0x94 - m */
  373.     X        1, "n",        /* 0x95 - n */
  374.     X        1, "o",        /* 0x96 - o */
  375.     X        1, "p",        /* 0x97 - p */
  376.     X        1, "q",        /* 0x98 - q */
  377.     X        1, "r",        /* 0x99 - r */
  378.     X        4, "_ a",    /* 0x9a - a underscore */
  379.     X        4, "_ o",    /* 0x9b - o underscore */
  380.     X        5, "\\(ae",    /* 0x9c - ae ligature */
  381.     X        4, "\\(cd",    /* 0x9d - Cedilla */
  382.     X        5, "\\(AE",    /* 0x9e - AE ligature */
  383.     X        6, "",        /* 0x9f - international currency symbol */
  384.     X        6, "",        /* 0xa0 - Micro */
  385.     X        1, "~",        /* 0xa1 - ~ */
  386.     X        1, "s",        /* 0xa2 - s */
  387.     X        1, "t",        /* 0xa3 - t */
  388.     X        1, "u",        /* 0xa4 - u */
  389.     X        1, "v",        /* 0xa5 - v */
  390.     X        1, "w",        /* 0xa6 - w */
  391.     X        1, "x",        /* 0xa7 - x */
  392.     X        1, "y",        /* 0xa8 - y */
  393.     X        1, "z",        /* 0xa9 - z */
  394.     X        6, "\\(!!",    /* 0xaa - inverted ! */
  395.     X        6, "\\(??",    /* 0xab - inverted ? */
  396.     X        6, "",        /* 0xac - D stroke */
  397.     X        4, "` Y",    /* 0xad - Y acute */
  398.     X        6, "",        /* 0xae - Capital Thorn */
  399.     X        5, "\\(co",    /* 0xaf - copyright */
  400.     X        5, "\\(ct",    /* 0xb0 - cent sign */
  401.     X        6, "",        /* 0xb1 - Pound sign */
  402.     X        6, "",        /* 0xb2 - Yen */
  403.     X        6, "",        /* 0xb3 - Peseta */
  404.     X        6, "",        /* 0xb4 - Floren, Guilder */
  405.     X        5, "\\(sc",    /* 0xb5 - section sign */
  406.     X        6, "\\(pa",    /* 0xb6 - paragraph sign */
  407.     X        5, "\\(14",    /* 0xb7 - one fourth */
  408.     X        5, "\\(12",    /* 0xb8 - one half */
  409.     X        5, "\\(34",    /* 0xb9 - three fourths*/
  410.     X        5, "\\(no",    /* 0xba - logical not */
  411.     X        5, "\\(or",    /* 0xbb - logical or */
  412.     X        6, "\\(mc",    /* 0xbc - overbar */
  413.     X        6, "\\(..",    /* 0xbd - diaeresis */
  414.     X        5, "\\(aa",    /* 0xbe - acute */
  415.     X        6, "",        /* 0xbf - double underscore */
  416.     X        1, "{",        /* 0xc0 - { */
  417.     X        1, "A",        /* 0xc1 - A */
  418.     X        1, "B",        /* 0xc2 - B */
  419.     X        1, "C",        /* 0xc3 - C */
  420.     X        1, "D",        /* 0xc4 - D */
  421.     X        1, "E",        /* 0xc5 - E */
  422.     X        1, "F",        /* 0xc6 - F */
  423.     X        1, "G",        /* 0xc7 - G */
  424.     X        1, "H",        /* 0xc8 - H */
  425.     X        1, "I",        /* 0xc9 - I */
  426.     X        2, "\\%",    /* 0xca - syllable hyphen */
  427.     X        4, "^ o",    /* 0xcb - o circumflex */
  428.     X        4, ".. o",    /* 0xcc - o diaresis */
  429.     X        4, "' o",    /* 0xcd - o grave */
  430.     X        4, "` o",    /* 0xce - o acute */
  431.     X        4, "~ o",    /* 0xcf - o tilde */
  432.     X        1, "}",        /* 0xd0 - } */
  433.     X        1, "J",        /* 0xd1 - J */
  434.     X        1, "K",        /* 0xd2 - K */
  435.     X        1, "L",        /* 0xd3 - L */
  436.     X        1, "M",        /* 0xd4 - M */
  437.     X        1, "N",        /* 0xd5 - N */
  438.     X        1, "O",        /* 0xd6 - O */
  439.     X        1, "P",        /* 0xd7 - P */
  440.     X        1, "Q",        /* 0xd8 - Q */
  441.     X        1, "R",        /* 0xd9 - R */
  442.     X        6, "\\(ui",    /* 0xda - dotless i */
  443.     X        4, "^ u",    /* 0xdb - u circumflex */
  444.     X        4, ".. u",    /* 0xdc - u diaresis */
  445.     X        4, "' u",    /* 0xdd - u grave */
  446.     X        4, "` u",    /* 0xde - u acute */
  447.     X        4, ".. y",    /* 0xdf - y diaresis */
  448.     X        1, "\\",    /* 0xe0 - \ */
  449.     X        2, "\\h'\\w'1'u'",    /* 0xe1 - numeric space */
  450.     X        1, "S",        /* 0xe2 - S */
  451.     X        1, "T",        /* 0xe3 - T */
  452.     X        1, "U",        /* 0xe4 - U */
  453.     X        1, "V",        /* 0xe5 - V */
  454.     X        1, "W",        /* 0xe6 - W */
  455.     X        1, "X",        /* 0xe7 - X */
  456.     X        1, "Y",        /* 0xe8 - Y */
  457.     X        1, "Z",        /* 0xe9 - Z */
  458.     X        6, "\\u\\s-22\\s+2\\d",    /* 0xea - superscript 2 */
  459.     X        4, "^ O",    /* 0xeb - O circumflex */
  460.     X        4, ".. O",    /* 0xec - O diaresis */
  461.     X        4, "' O",    /* 0xed - O grave */
  462.     X        4, "` O",    /* 0xee - O acute */
  463.     X        4, "~ O",    /* 0xef - O tilde */
  464.     X        1, "0",        /* 0xf0 - 0 */
  465.     X        1, "1",        /* 0xf1 - 1 */
  466.     X        1, "2",        /* 0xf2 - 2 */
  467.     X        1, "3",        /* 0xf3 - 3 */
  468.     X        1, "4",        /* 0xf4 - 4 */
  469.     X        1, "5",        /* 0xf5 - 5 */
  470.     X        1, "6",        /* 0xf6 - 6 */
  471.     X        1, "7",        /* 0xf7 - 7 */
  472.     X        1, "8",        /* 0xf8 - 8 */
  473.     X        1, "9",        /* 0xf9 - 9 */
  474.     X        6, "\\u\\s-23\\s+2\\d",    /* 0xfa - superscript 3 */
  475.     X        4, "^ U",    /* 0xfb - U circumflex */
  476.     X        4, ".. U",    /* 0xfc - U diaresis */
  477.     X        4, "' U",    /* 0xfd - U grave */
  478.     X        4, "` U",    /* 0xfe - U acute */
  479.     X        6, "",        /* 0xff - "Eight Ones" */
  480.     X};
  481. SHAR_EOF
  482. if test 8517 -ne "`wc -c < 'ebtab.h'`"
  483. then
  484.     echo shar: error transmitting "'ebtab.h'" '(should have been 8517 characters)'
  485. fi
  486. chmod +x 'ebtab.h'
  487. fi # end of overwriting check
  488. echo shar: extracting "'dca2troff.c'" '(785 characters)'
  489. if test -f 'dca2troff.c'
  490. then
  491.     echo shar: will not over-write existing file "'dca2troff.c'"
  492. else
  493. sed 's/^    X//' << \SHAR_EOF > 'dca2troff.c'
  494.     X#include "dca2troff.h"
  495.     X
  496.     X
  497.     X/* dca is a series of structured fields */
  498.     X
  499.     Xmain()
  500.     X{
  501.     X    for (;;)
  502.     X    {                /* do a structured field */
  503.     X    sf_incnt = 0;            /* init the character count */
  504.     X    sf_length = get1num();         /* positive - includes length bytes */
  505.     X    sf_class = get1ch();        /* get the paramaters for the field */
  506.     X    sf_type = get1ch();
  507.     X    sf_format = get1ch();
  508.     X
  509.     X    switch (sf_class)        /* what class of sf? */
  510.     X        {
  511.     X        case 0xe1:
  512.     X        do_sfe1();
  513.     X        break;
  514.     X        case 0xe2:
  515.     X        do_sfe2();
  516.     X        break;
  517.     X        case 0xe3:
  518.     X        do_sfe3();
  519.     X        break;
  520.     X        case 0xe4:
  521.     X        do_sfe4();
  522.     X        break;
  523.     X        case 0xe5:
  524.     X        do_sfe5();
  525.     X        break;
  526.     X        case 0xe6:
  527.     X        do_sfe6();
  528.     X        break;
  529.     X        case 0xe8:
  530.     X        do_sfe8();
  531.     X        break;
  532.     X        case 0xe9:
  533.     X        do_sfe9();
  534.     X        break;
  535.     X        default:
  536.     X        fprintf(stderr, "Unknown SF class (%02x)\n", sf_class); 
  537.     X        }
  538.     X    }
  539.     X}
  540. SHAR_EOF
  541. if test 785 -ne "`wc -c < 'dca2troff.c'`"
  542. then
  543.     echo shar: error transmitting "'dca2troff.c'" '(should have been 785 characters)'
  544. fi
  545. chmod +x 'dca2troff.c'
  546. fi # end of overwriting check
  547. echo shar: extracting "'do_accent.c'" '(1627 characters)'
  548. if test -f 'do_accent.c'
  549. then
  550.     echo shar: will not over-write existing file "'do_accent.c'"
  551. else
  552. sed 's/^    X//' << \SHAR_EOF > 'do_accent.c'
  553.     X/* do an accented char */
  554.     X
  555.     X/* input is a string with the accent to print then a space then the  */
  556.     X/*    character to accent */
  557.     X
  558.     X#include "dca2troff.h"
  559.     X#include <ctype.h>
  560.     X
  561.     Xstruct acc {
  562.     X    char *generic;
  563.     X    char *output;
  564.     X} lacc[] = {        /* lower case accents */
  565.     X    "`",    "\\(ga",        /* grave */
  566.     X    "'",    "\\(aa",        /* acute */
  567.     X    "^",    "^",            /* circumflex */
  568.     X    "~",    "~",            /* tilde */
  569.     X    "..",    "\\(..",        /* diaresis */
  570.     X    "de",    "\\(de",        /* angstrom */
  571.     X    "cd",    "\\(cd",        /* cedilla */
  572.     X    "",    ""
  573.     X};
  574.     Xstruct acc uacc[] = {    /* upper case accents */
  575.     X    "`",    "\\f(Sr\\(ga\\fP",    /* grave */
  576.     X    "'",    "\\f(Sr\\(aa\\fP",    /* acute */
  577.     X    "^",    "\\f(Sr^\\fP",        /* circumflex */
  578.     X    "~",    "\\f(Sr~\\fP",        /* tilde */
  579.     X    "..",    "\\f(Sr\\(..\\fP",    /* diaresis */
  580.     X    "de",    "\\f(Sr\\(de\\fP",    /* angstrom */
  581.     X    "cd",    "\\(cd",        /* cedilla */
  582.     X    "",    ""
  583.     X};
  584.     X#include "dca2troff.h"
  585.     Xdo_accent(str)
  586.     Xchar *str;
  587.     X{
  588.     X    char accent[10];
  589.     X    char character;
  590.     X    int i;
  591.     X
  592.     X    sscanf(str, "%s %c", accent, &character);
  593.     X
  594.     X    if ( islower(character) )    /* lower case character no problem */
  595.     X        {
  596.     X        i = checkacc(lacc, accent);
  597.     X        if ( i == -1 )
  598.     X            {
  599.     X            fprintf(stderr, "unknown accent %s\n", accent);
  600.     X            return(0);
  601.     X            }
  602.     X        sprintf(tline, "\\o'%s%c'", lacc[i], character);
  603.     X        }
  604.     X    else
  605.     X        {
  606.     X        i = checkacc(uacc, accent);
  607.     X        if ( i == -1 )
  608.     X            {
  609.     X            fprintf(stderr, "unknown accent %s\n", accent);
  610.     X            return(0);
  611.     X            }
  612.     X        sprintf(tline, "\\u\\z%s\\d%c", uacc[i], character);
  613.     X        }
  614.     X    outstr(tline);
  615.     X}
  616.     X
  617.     X/* search for accent string in struct */
  618.     X/* return index if ok, else -1 */
  619.     Xcheckacc(str, s)
  620.     Xchar *str[];
  621.     Xchar *s;
  622.     X{
  623.     X    int i;
  624.     X    for(i=0;;i++)
  625.     X        {
  626.     X        if((strcmp(str[i], "\0") == 0 ))
  627.     X            return(-1);
  628.     X        if((strcmp(str[i], s) == 0 ))
  629.     X            return(i);
  630.     X        }
  631.     X}
  632. SHAR_EOF
  633. if test 1627 -ne "`wc -c < 'do_accent.c'`"
  634. then
  635.     echo shar: error transmitting "'do_accent.c'" '(should have been 1627 characters)'
  636. fi
  637. chmod +x 'do_accent.c'
  638. fi # end of overwriting check
  639. echo shar: extracting "'do_mbd1.c'" '(3462 characters)'
  640. if test -f 'do_mbd1.c'
  641. then
  642.     echo shar: will not over-write existing file "'do_mbd1.c'"
  643. else
  644. sed 's/^    X//' << \SHAR_EOF > 'do_mbd1.c'
  645.     X#include "dca2troff.h"
  646.     X
  647.     Xstruct fnts {
  648.     X    int gfid;        /* GFID i.e. font number */
  649.     X    char *dfnt;        /* use this troff font for now */
  650.     X    char *fntname;        /* font name */
  651.     X} fnttab[] = {
  652.     X    1,    "1",    "Advocate",
  653.     X    2,    "1",    "Delegate",
  654.     X    3,    "1",    "OCR-B",
  655.     X    4,    "1",    "Polygo Pica",
  656.     X    5,    "1",    "Orator",
  657.     X    6,    "2",    "Light Italic 10",
  658.     X    7,    "1",    "OCR-M",
  659.     X    8,    "1",    "Scribe 10",
  660.     X    9,    "1",    "Large Pica",
  661.     X    10,    "1",    "Cyrillic 22",
  662.     X    11,    "1",    "Courier 10",
  663.     X    12,    "1",    "Prestige Pica",
  664.     X    13,    "1",    "Artisan 10",
  665.     X    14,    "1",    "Manifold",
  666.     X    15,    "1",    "Bookface Academic",
  667.     X    16,    "1",    "Latin 10 High Speed",
  668.     X    17,    "1",    "1403 OCR",
  669.     X    18,    "2",    "Courier Italic 10",
  670.     X    19,    "1",    "OCR-A",
  671.     X    20,    "1",    "PICA",
  672.     X    21,    "1",    "Katakana Light",
  673.     X    22,    "1",    "Printing & Publishing 12 Number 3",
  674.     X    23,    "2",    "Light Italic 10 Mod",
  675.     X    24,    "1",    "Presentor",
  676.     X    80,    "1",    "Scribe",
  677.     X    81,    "1",    "Artisan 12",
  678.     X    82,    "1",    "Auto Elite",
  679.     X    83,    "1",    "Elite",
  680.     X    84,    "1",    "Script",
  681.     X    85,    "1",    "Courier 12",
  682.     X    86,    "1",    "Prestige Elite",
  683.     X    87,    "1",    "Letter Gothic",
  684.     X    88,    "1",    "High Speed Latin 12",
  685.     X    89,    "1",    "Large Elite",
  686.     X    90,    "1",    "Dual Gothic",
  687.     X    91,    "2",    "Light Italic 12",
  688.     X    92,    "2",    "Courier 12 Italic",
  689.     X    93,    "1",    "Polygo Elite",
  690.     X    94,    "1",    "Diplomat",
  691.     X    95,    "1",    "Adjutant",
  692.     X    96,    "1",    "Olde World",
  693.     X    97,    "2",    "Light Italic 12 Mod",
  694.     X    155,    "2",    "Boldface Italic",
  695.     X    156,    "1",    "Thesis",
  696.     X    157,    "1",    "Title",
  697.     X    158,    "1",    "Modern",
  698.     X    159,    "1",    "Boldface",
  699.     X    160,    "1",    "Essay",
  700.     X    161,    "1",    "Arcadia",
  701.     X    162,    "2",    "Essay Italic",
  702.     X    163,    "3",    "Essay Bold",
  703.     X    165,    "1",    "High Speed Latin PSM",
  704.     X    221,    "1",    "Prestige 15",
  705.     X    222,    "1",    "Gothic 15",
  706.     X    223,    "1",    "Courier 15",
  707.     X    224,    "1",    "Rotated Data 1 15",
  708.     X    225,    "1",    "Scribe 15",
  709.     X    0,    "",    ""
  710.     X};
  711.     X
  712.     X/* multi byte class d1 */
  713.     Xdo_mbd1()
  714.     X{
  715.     X/* the "???????" entries were found in some dw3 files but are not
  716.     X    documented */
  717.     X
  718.     X    switch (mb_type)
  719.     X    {
  720.     X    case 0x8a:            /* ???????? */
  721.     X    case 0x8e:            /* ???????? */
  722.     X        do_flush(mb_count);
  723.     X        return;
  724.     X    case 0x01:            /* SCG   - Set GCGID thru GCID */
  725.     X        itemp = get1num();            /* get GCID1 */
  726.     X        jtemp = get1num();            /* get GCID2 */
  727.     X        mb_count = mb_count -4;
  728.     X        sprintf(tline, "\\\" graphic character set request: GCID1=%d, GCID2=%d\n", itemp, jtemp);
  729.     X        do_flush(mb_count);
  730.     X        return;
  731.     X    case 0x05:            /* SFG   - Set CFID thru GFID */
  732.     X        itemp = get1num();            /* get GFID */
  733.     X        jtemp = get1num();            /* get font width */
  734.     X        ctemp = get1ch();            /* get font attribute */
  735.     X        mb_count = mb_count - 5;
  736.     X        for(ltemp=0;fnttab[ltemp].gfid != itemp; ltemp++)
  737.     X        {
  738.     X        if(fnttab[ltemp].gfid == 0)
  739.     X            {
  740.     X                sprintf(tline, "\\\" font request: GFID=%d, width=%d, ",itemp, jtemp);
  741.     X            }
  742.     X        }
  743.     X        if(fnttab[ltemp].gfid == itemp)
  744.     X            {
  745.     X                sprintf(tline, "\\\" font request: font='%s', width=%d, ",fnttab[ltemp].fntname, jtemp);
  746.     X            }
  747.     X        outstr(tline);
  748.     X        if(ctemp == 1)
  749.     X        outstr("monospace\n");
  750.     X        else
  751.     X        outstr("proportionally spaced\n");
  752.     X        if(fnttab[ltemp].gfid == itemp)
  753.     X            {
  754.     X            sprintf(tline, "\\f%s", fnttab[ltemp].dfnt);
  755.     X                outstr(tline);
  756.     X            }
  757.     X        do_flush(mb_count);
  758.     X        return;
  759.     X    case 0x15:            /* IEG   - Insert Escaped Graphic */
  760.     X        if(mb_count >= 3)
  761.     X        {
  762.     X        itemp = get1num();        /* get code page */
  763.     X        ctemp = get1ch();        /* get character code */
  764.     X        mb_count = mb_count - 3;
  765.     X        sprintf(tline, "\\\" special character request: code page=%d, character code=x%02x\n", itemp, ctemp);
  766.     X        outstr(tline);
  767.     X        }
  768.     X        do_flush(mb_count);
  769.     X        return;
  770.     X    default:
  771.     X        fprintf(stderr, "unknown mb d1 type (%02x)\n", mb_type);
  772.     X        do_flush(mb_count);
  773.     X        return;
  774.     X    }
  775.     X}
  776. SHAR_EOF
  777. if test 3462 -ne "`wc -c < 'do_mbd1.c'`"
  778. then
  779.     echo shar: error transmitting "'do_mbd1.c'" '(should have been 3462 characters)'
  780. fi
  781. chmod +x 'do_mbd1.c'
  782. fi # end of overwriting check
  783. echo shar: extracting "'do_mbd2.c'" '(375 characters)'
  784. if test -f 'do_mbd2.c'
  785. then
  786.     echo shar: will not over-write existing file "'do_mbd2.c'"
  787. else
  788. sed 's/^    X//' << \SHAR_EOF > 'do_mbd2.c'
  789.     X
  790.     X#include "dca2troff.h"
  791.     X
  792.     X/* multi byte class d2 */
  793.     Xdo_mbd2()
  794.     X{
  795.     X    switch (mb_type)
  796.     X    {
  797.     X    case 0x01:            /* STAB  - Set Tabs */
  798.     X    case 0x0b:            /* RLM   - Release Left Margin */
  799.     X    case 0x35:            /* SVA   - Set Visual Attributes */
  800.     X        do_flush(mb_count);
  801.     X        return;
  802.     X    default:
  803.     X        fprintf(stderr, "unknown mb d2 type (%02x)\n", mb_type);
  804.     X        do_flush(mb_count);
  805.     X        return;
  806.     X    }
  807.     X}
  808. SHAR_EOF
  809. if test 375 -ne "`wc -c < 'do_mbd2.c'`"
  810. then
  811.     echo shar: error transmitting "'do_mbd2.c'" '(should have been 375 characters)'
  812. fi
  813. chmod +x 'do_mbd2.c'
  814. fi # end of overwriting check
  815. echo shar: extracting "'do_mbd4.c'" '(2019 characters)'
  816. if test -f 'do_mbd4.c'
  817. then
  818.     echo shar: will not over-write existing file "'do_mbd4.c'"
  819. else
  820. sed 's/^    X//' << \SHAR_EOF > 'do_mbd4.c'
  821.     X
  822.     X#include "dca2troff.h"
  823.     X
  824.     X/* multi byte class d4 */
  825.     Xdo_mbd4()
  826.     X{
  827.     X    switch (mb_type)
  828.     X    {
  829.     X    case 0x02:            /* BLFC  - Begin Line Fmt. Change */
  830.     X    case 0x04:            /* RMLF  - Return to Mstr. Line Fmt. */
  831.     X    case 0x05:            /* SLP   - Set Line Parameters */
  832.     X    case 0x06:            /* ELFC  - End Line Fmt. Change */
  833.     X    case 0x13:            /* ATL   - Return To Master Font */
  834.     X    case 0x47:            /* PPIN  - Print Page Image Number */
  835.     X    case 0x63:            /* PTUN  - Print Text Unit Name */
  836.     X    case 0x72:            /* BOS   - Begin Overstrike */
  837.     X    case 0x76:            /* EOS   - End Overstrike */
  838.     X    case 0x7a:            /* BLM   - Begin Linguistic Mark */
  839.     X    case 0x7e:            /* ELM   - End Linguistic Mark */
  840.     X        do_flush(mb_count);
  841.     X        return;
  842.     X    case 0x0a:            /* BUS   - Begin Underscore */
  843.     X        outstr("\\fI");
  844.     X        do_flush(mb_count);
  845.     X        return;
  846.     X    case 0x0b:            /* ATF   - Align Text Field */
  847.     X        itemp = get1ch();            /* get alignment type */
  848.     X        --mb_count;
  849.     X        jtemp = 0;
  850.     X        if(mb_count >= 2)
  851.     X        {
  852.     X        jtemp = get1num();        /* get alignment pos */
  853.     X        --mb_count;
  854.     X        --mb_count;
  855.     X        }
  856.     X        if(itemp == 3)            /* center request */
  857.     X        outstr("\n.ce\n");
  858.     X        do_flush(mb_count);
  859.     X        return;
  860.     X    case 0x0e:            /* EUS   - End Underscore */
  861.     X        outstr("\\fR");
  862.     X        do_flush(mb_count);
  863.     X        return;
  864.     X    case 0x0f:            /* ATL   - Align Text Line */
  865.     X        itemp = get1ch();            /* get alignment type */
  866.     X        --mb_count;
  867.     X        if(itemp == 1)            /* center */
  868.     X        outstr("\n.ce\n");
  869.     X        if(itemp == 2)            /* right */
  870.     X        ;
  871.     X        do_flush(mb_count);
  872.     X        return;
  873.     X    case 0x62:            /* BK    - Begin Keep */
  874.     X        outstr("\\\" Begin Keep\n");
  875.     X        do_flush(mb_count);
  876.     X        return;
  877.     X    case 0x66:            /* EK    - End Keep */
  878.     X        outstr("\\\" End Keep\n");
  879.     X        do_flush(mb_count);
  880.     X        return;
  881.     X    case 0x90:            /* DPS   - Display Prompt and Stop */
  882.     X        ctemp = get1ch();            /* get prompt */
  883.     X        sprintf(tline, "\\\" DPS found - keyboard data request, prompt=x%02x\n", ctemp);
  884.     X        outstr(tline);
  885.     X        do_flush(mb_count);
  886.     X        return;
  887.     X    default:
  888.     X        fprintf(stderr, "unknown mb d4 type (%02x)\n", mb_type);
  889.     X        do_flush(mb_count);
  890.     X        return;
  891.     X    }
  892.     X}
  893. SHAR_EOF
  894. if test 2019 -ne "`wc -c < 'do_mbd4.c'`"
  895. then
  896.     echo shar: error transmitting "'do_mbd4.c'" '(should have been 2019 characters)'
  897. fi
  898. chmod +x 'do_mbd4.c'
  899. fi # end of overwriting check
  900. echo shar: extracting "'do_mbd8.c'" '(939 characters)'
  901. if test -f 'do_mbd8.c'
  902. then
  903.     echo shar: will not over-write existing file "'do_mbd8.c'"
  904. else
  905. sed 's/^    X//' << \SHAR_EOF > 'do_mbd8.c'
  906.     X
  907.     X#include "dca2troff.h"
  908.     X
  909.     X/* multi byte class d8 */
  910.     Xdo_mbd8()
  911.     X{
  912.     X    switch (mb_type)
  913.     X    {
  914.     X    case 0x82:            /* SSCA  - Set Spelling Check Attrib. */
  915.     X    case 0x94:            /* CWB   - Conditional Word Break */
  916.     X    case 0x95:            /* NPD   - Note Partition Delimiter */
  917.     X    case 0x96:            /* LOP   - Locate Process Output */
  918.     X        do_flush(mb_count);
  919.     X        return;
  920.     X    case 0x62:            /* BCL   - Begin Column Layout */
  921.     X        outstr("\\\" Begin Column Layout request\n");
  922.     X        do_flush(mb_count);
  923.     X        return;
  924.     X    case 0x66:            /* ECL   - End Column Layout */
  925.     X        outstr("\\\" End Column Layout request\n");
  926.     X        do_flush(mb_count);
  927.     X        return;
  928.     X    case 0x6a:            /* BFT   - Begin Formatted Text */
  929.     X        outstr("\n.nf\n");
  930.     X        do_flush(mb_count);
  931.     X        return;
  932.     X    case 0x6e:            /* EFT   - End Formatted Text */
  933.     X        outstr("\n.fi\n");
  934.     X        do_flush(mb_count);
  935.     X        return;
  936.     X    default:
  937.     X        fprintf(stderr, "unknown mb d8 type (%02x)\n", mb_type);
  938.     X        do_flush(mb_count);
  939.     X        return;
  940.     X    }
  941.     X}
  942. SHAR_EOF
  943. if test 939 -ne "`wc -c < 'do_mbd8.c'`"
  944. then
  945.     echo shar: error transmitting "'do_mbd8.c'" '(should have been 939 characters)'
  946. fi
  947. chmod +x 'do_mbd8.c'
  948. fi # end of overwriting check
  949. echo shar: extracting "'do_mbd9.c'" '(603 characters)'
  950. if test -f 'do_mbd9.c'
  951. then
  952.     echo shar: will not over-write existing file "'do_mbd9.c'"
  953. else
  954. sed 's/^    X//' << \SHAR_EOF > 'do_mbd9.c'
  955.     X
  956.     X#include "dca2troff.h"
  957.     X
  958.     X/* multi byte class d9 */
  959.     Xdo_mbd9()
  960.     X{
  961.     X    switch (mb_type)
  962.     X    {
  963.     X    case 0x6a:            /* AO   - Auto-Outline */
  964.     X    case 0x82:            /* INS  - Insert */
  965.     X    case 0x85:            /* NR   - Note Reference */
  966.     X    case 0x86:            /* NTR  - Note Text Reference */
  967.     X        do_flush(mb_count);
  968.     X        return;
  969.     X    case 0x81:            /* IU   - Include Unit */
  970.     X        fprintf(stderr, " This document has a request to include another document\n");
  971.     X        outstr("\\\" Include request");
  972.     X        do_flush(mb_count);
  973.     X        return;
  974.     X    default:
  975.     X        fprintf(stderr, "unknown mb d9 type (%02x)\n", mb_type);
  976.     X        do_flush(mb_count);
  977.     X        return;
  978.     X    }
  979.     X}
  980.     X
  981. SHAR_EOF
  982. if test 603 -ne "`wc -c < 'do_mbd9.c'`"
  983. then
  984.     echo shar: error transmitting "'do_mbd9.c'" '(should have been 603 characters)'
  985. fi
  986. chmod +x 'do_mbd9.c'
  987. fi # end of overwriting check
  988. echo shar: extracting "'do_multi.c'" '(552 characters)'
  989. if test -f 'do_multi.c'
  990. then
  991.     echo shar: will not over-write existing file "'do_multi.c'"
  992. else
  993. sed 's/^    X//' << \SHAR_EOF > 'do_multi.c'
  994.     X#include "dca2troff.h"
  995.     X
  996.     Xdo_multi()
  997.     X{
  998.     X    char c;
  999.     X
  1000.     X    mb_class = get1ch();
  1001.     X    mb_count = get1ch();
  1002.     X    mb_type = get1ch();
  1003.     X
  1004.     X    mb_count &= 0377;        /* count is a 1 byte value */
  1005.     X    mb_count = mb_count - 2;        /* count includes count and type */
  1006.     X
  1007.     X    switch (mb_class)
  1008.     X    {
  1009.     X    case 0xd1:
  1010.     X        do_mbd1();
  1011.     X        return;
  1012.     X    case 0xd2:
  1013.     X        do_mbd2();
  1014.     X        return;
  1015.     X    case 0xd4:
  1016.     X        do_mbd4();
  1017.     X        return;
  1018.     X    case 0xd8:
  1019.     X        do_mbd8();
  1020.     X        return;
  1021.     X    case 0xd9:
  1022.     X        do_mbd9();
  1023.     X        return;
  1024.     X    default:
  1025.     X        fprintf(stderr, "unknown mb_class ( %02x )\n", mb_class);
  1026.     X        do_flush(mb_count);
  1027.     X        return;
  1028.     X    }
  1029.     X}
  1030. SHAR_EOF
  1031. if test 552 -ne "`wc -c < 'do_multi.c'`"
  1032. then
  1033.     echo shar: error transmitting "'do_multi.c'" '(should have been 552 characters)'
  1034. fi
  1035. chmod +x 'do_multi.c'
  1036. fi # end of overwriting check
  1037. echo shar: extracting "'do_sce4.c'" '(206 characters)'
  1038. if test -f 'do_sce4.c'
  1039. then
  1040.     echo shar: will not over-write existing file "'do_sce4.c'"
  1041. else
  1042. sed 's/^    X//' << \SHAR_EOF > 'do_sce4.c'
  1043.     X#include "dca2troff.h"
  1044.     X/* structured field class e4 */
  1045.     Xdo_sfe4()
  1046.     X{
  1047.     X    switch(sf_type)
  1048.     X    {
  1049.     X    case 0x02:            /* PM   - Print Medium */
  1050.     X    case 0x03:            /* OM   - Operator Message */
  1051.     X    default:
  1052.     X        flush_sf();
  1053.     X    }
  1054.     X}
  1055. SHAR_EOF
  1056. if test 206 -ne "`wc -c < 'do_sce4.c'`"
  1057. then
  1058.     echo shar: error transmitting "'do_sce4.c'" '(should have been 206 characters)'
  1059. fi
  1060. chmod +x 'do_sce4.c'
  1061. fi # end of overwriting check
  1062. echo shar: extracting "'do_sfe1.c'" '(362 characters)'
  1063. if test -f 'do_sfe1.c'
  1064. then
  1065.     echo shar: will not over-write existing file "'do_sfe1.c'"
  1066. else
  1067. sed 's/^    X//' << \SHAR_EOF > 'do_sfe1.c'
  1068.     X#include "dca2troff.h"
  1069.     X
  1070.     X/* structured field class e1 */
  1071.     Xdo_sfe1()
  1072.     X{
  1073.     X    switch(sf_type)
  1074.     X    {
  1075.     X    case 0x03:            /* FUP  - Format Unit Prefix */
  1076.     X    case 0x04:            /* TUP  - Text Unit Prefix */
  1077.     X    case 0x06:            /* EUP  - End Unit Prefix */
  1078.     X        flush_sf();
  1079.     X        return;
  1080.     X    default:
  1081.     X        fprintf(stderr, "unknown sf e1 type (x%02x)\n", sf_type);
  1082.     X        flush_sf();
  1083.     X        return;
  1084.     X    }
  1085.     X}
  1086. SHAR_EOF
  1087. if test 362 -ne "`wc -c < 'do_sfe1.c'`"
  1088. then
  1089.     echo shar: error transmitting "'do_sfe1.c'" '(should have been 362 characters)'
  1090. fi
  1091. chmod +x 'do_sfe1.c'
  1092. fi # end of overwriting check
  1093. echo shar: extracting "'do_sfe2.c'" '(782 characters)'
  1094. if test -f 'do_sfe2.c'
  1095. then
  1096.     echo shar: will not over-write existing file "'do_sfe2.c'"
  1097. else
  1098. sed 's/^    X//' << \SHAR_EOF > 'do_sfe2.c'
  1099.     Xstruct lang {
  1100.     X    int splangn;
  1101.     X    char *splang;
  1102.     X} spellchk[] = {
  1103.     X    0,    "No spellcheck",
  1104.     X    1,    "American English",
  1105.     X    2,    "UK English",
  1106.     X    3,    "German",
  1107.     X    4,    "Dutch",
  1108.     X    5,    "National French",
  1109.     X    6,    "Canadian French",
  1110.     X    7,    "Italian",
  1111.     X    8,    "Spanish",
  1112.     X    9,    "Swedish",
  1113.     X    10,    "Finnish",
  1114.     X    11,    "Danish",
  1115.     X    12,    "Norwegian",
  1116.     X    0xffff,    "Use current language"
  1117.     X};
  1118.     X
  1119.     X#include "dca2troff.h"
  1120.     X/* structured field class e2 */
  1121.     Xdo_sfe2()
  1122.     X{
  1123.     X    switch(sf_type)
  1124.     X    {
  1125.     X    case 0x01:            /* PMF  - Primary Master Format */
  1126.     X    case 0x02:            /* AMF  - Alternate Master Format */
  1127.     X    case 0x04:            /* TUFC - Text Unit Format Change */
  1128.     X        flush_sf();
  1129.     X        return;
  1130.     X    case 0x05:            /* DP   - Document Parameters */
  1131.     X        flush_sf();
  1132.     X        return;
  1133.     X    default:
  1134.     X        fprintf(stderr, "unknown sf e2 type (x%02x)\n", sf_type);
  1135.     X        flush_sf();
  1136.     X        return;
  1137.     X    }
  1138.     X}
  1139. SHAR_EOF
  1140. if test 782 -ne "`wc -c < 'do_sfe2.c'`"
  1141. then
  1142.     echo shar: error transmitting "'do_sfe2.c'" '(should have been 782 characters)'
  1143. fi
  1144. chmod +x 'do_sfe2.c'
  1145. fi # end of overwriting check
  1146. echo shar: extracting "'do_sfe3.c'" '(385 characters)'
  1147. if test -f 'do_sfe3.c'
  1148. then
  1149.     echo shar: will not over-write existing file "'do_sfe3.c'"
  1150. else
  1151. sed 's/^    X//' << \SHAR_EOF > 'do_sfe3.c'
  1152.     X#include "dca2troff.h"
  1153.     X/* structured field class e3 */
  1154.     Xdo_sfe3()
  1155.     X{
  1156.     X    switch(sf_type)
  1157.     X    {
  1158.     X    case 0x01:            /* EPM  - Estab Primary Master Fmt */
  1159.     X    case 0x02:            /* EAM  - Estab Alternate Master Fmt */
  1160.     X    case 0x03:            /* RTMF - Return to Master Format */
  1161.     X        flush_sf();
  1162.     X        return;
  1163.     X    default:
  1164.     X        fprintf(stderr, "unknown sf e3 type (x%02x)\n", sf_type);
  1165.     X        flush_sf();
  1166.     X        return;
  1167.     X    }
  1168.     X}
  1169. SHAR_EOF
  1170. if test 385 -ne "`wc -c < 'do_sfe3.c'`"
  1171. then
  1172.     echo shar: error transmitting "'do_sfe3.c'" '(should have been 385 characters)'
  1173. fi
  1174. chmod +x 'do_sfe3.c'
  1175. fi # end of overwriting check
  1176. echo shar: extracting "'do_sfe4.c'" '(314 characters)'
  1177. if test -f 'do_sfe4.c'
  1178. then
  1179.     echo shar: will not over-write existing file "'do_sfe4.c'"
  1180. else
  1181. sed 's/^    X//' << \SHAR_EOF > 'do_sfe4.c'
  1182.     X
  1183.     X#include "dca2troff.h"
  1184.     X
  1185.     X/* structured field class e4 */
  1186.     Xdo_sfe4()
  1187.     X{
  1188.     X    switch(sf_type)
  1189.     X    {
  1190.     X    case 0x02:            /* PM   - Print Medium */
  1191.     X    case 0x03:            /* OM   - Operator Message */
  1192.     X        flush_sf();
  1193.     X        return;
  1194.     X    default:
  1195.     X        fprintf(stderr, "unknown sf e4 type (x%02x)\n", sf_type);
  1196.     X        flush_sf();
  1197.     X        return;
  1198.     X    }
  1199.     X}
  1200. SHAR_EOF
  1201. if test 314 -ne "`wc -c < 'do_sfe4.c'`"
  1202. then
  1203.     echo shar: error transmitting "'do_sfe4.c'" '(should have been 314 characters)'
  1204. fi
  1205. chmod +x 'do_sfe4.c'
  1206. fi # end of overwriting check
  1207. echo shar: extracting "'do_sfe5.c'" '(430 characters)'
  1208. if test -f 'do_sfe5.c'
  1209. then
  1210.     echo shar: will not over-write existing file "'do_sfe5.c'"
  1211. else
  1212. sed 's/^    X//' << \SHAR_EOF > 'do_sfe5.c'
  1213.     X#include "dca2troff.h"
  1214.     X/* structured field class e5 */
  1215.     Xdo_sfe5()
  1216.     X{
  1217.     X    switch(sf_type)
  1218.     X    {
  1219.     X    case 0x01:            /* MPB  - Bottom Margin Text Param */
  1220.     X    case 0x04:            /* MPT  - Top Margin Text Parameters */
  1221.     X    case 0x07:            /* PIP  - Page Image Parametrs */
  1222.     X    case 0x08:            /* PIN  - Page Image Numbering */
  1223.     X        flush_sf();
  1224.     X        return;
  1225.     X    default:
  1226.     X        fprintf(stderr, "unknown sf e5 type (x%02x)\n", sf_type);
  1227.     X        flush_sf();
  1228.     X        return;
  1229.     X    }
  1230.     X}
  1231. SHAR_EOF
  1232. if test 430 -ne "`wc -c < 'do_sfe5.c'`"
  1233. then
  1234.     echo shar: error transmitting "'do_sfe5.c'" '(should have been 430 characters)'
  1235. fi
  1236. chmod +x 'do_sfe5.c'
  1237. fi # end of overwriting check
  1238. echo shar: extracting "'do_sfe6.c'" '(352 characters)'
  1239. if test -f 'do_sfe6.c'
  1240. then
  1241.     echo shar: will not over-write existing file "'do_sfe6.c'"
  1242. else
  1243. sed 's/^    X//' << \SHAR_EOF > 'do_sfe6.c'
  1244.     X#include "dca2troff.h"
  1245.     X/* structured field class e6 */
  1246.     Xdo_sfe6()
  1247.     X{
  1248.     X    switch(sf_type)
  1249.     X    {
  1250.     X    case 0x01:            /* LP  - Line Parameters */
  1251.     X    case 0x02:            /* TP  - Tab Parameters */
  1252.     X    case 0x03:            /* LN  - Line Numbering */
  1253.     X        flush_sf();
  1254.     X        return;
  1255.     X    default:
  1256.     X        fprintf(stderr, "unknown sf e6 type (x%02x)\n", sf_type);
  1257.     X        flush_sf();
  1258.     X        return;
  1259.     X    }
  1260.     X}
  1261. SHAR_EOF
  1262. if test 352 -ne "`wc -c < 'do_sfe6.c'`"
  1263. then
  1264.     echo shar: error transmitting "'do_sfe6.c'" '(should have been 352 characters)'
  1265. fi
  1266. chmod +x 'do_sfe6.c'
  1267. fi # end of overwriting check
  1268. echo shar: extracting "'do_sfe8.c'" '(626 characters)'
  1269. if test -f 'do_sfe8.c'
  1270. then
  1271.     echo shar: will not over-write existing file "'do_sfe8.c'"
  1272. else
  1273. sed 's/^    X//' << \SHAR_EOF > 'do_sfe8.c'
  1274.     X#include "dca2troff.h"
  1275.     X/* structured field class e8 */
  1276.     Xdo_sfe8()
  1277.     X{
  1278.     X    switch(sf_type)
  1279.     X    {                /* Margin Text */
  1280.     X    case 0x01:            /* MTTA - Top Margin - All Pages */
  1281.     X    case 0x02:            /* MTTO - Top Margin - Odd Pages */
  1282.     X    case 0x03:            /* MTTE - Top Margin - Even Pages */
  1283.     X    case 0x04:            /* MTBA - Bottom Margin - All Pages */
  1284.     X    case 0x05:            /* MTBO - Bottom Margin - Odd Pages */
  1285.     X    case 0x06:            /* MTBE - Bottom Margin - Even Pages */
  1286.     X        flush_sf();
  1287.     X        return;
  1288.     X    case 0x07:            /* BT   - Body Text */
  1289.     X        do_text();
  1290.     X        return;
  1291.     X    default:
  1292.     X        fprintf(stderr, "unknown sf e8 type (x%02x)\n", sf_type);
  1293.     X        flush_sf();
  1294.     X        return;
  1295.     X    }
  1296.     X}
  1297. SHAR_EOF
  1298. if test 626 -ne "`wc -c < 'do_sfe8.c'`"
  1299. then
  1300.     echo shar: error transmitting "'do_sfe8.c'" '(should have been 626 characters)'
  1301. fi
  1302. chmod +x 'do_sfe8.c'
  1303. fi # end of overwriting check
  1304. echo shar: extracting "'do_sfe9.c'" '(487 characters)'
  1305. if test -f 'do_sfe9.c'
  1306. then
  1307.     echo shar: will not over-write existing file "'do_sfe9.c'"
  1308. else
  1309. sed 's/^    X//' << \SHAR_EOF > 'do_sfe9.c'
  1310.     X#include "dca2troff.h"
  1311.     X/* structured field class e9 */
  1312.     Xdo_sfe9()
  1313.     X{
  1314.     X    switch(sf_type)
  1315.     X    {
  1316.     X    case 0x01:            /* PFA  - Punct. Format. Arithmetic */
  1317.     X    case 0x02:            /* PFC  - Punct. Format. Character */
  1318.     X    case 0x03:            /* NFP  - Note Format Paramerers */
  1319.     X    case 0x04:            /* AOP  - Auto-Outline Parameters */
  1320.     X    case 0x05:            /* PFP  - Page Formating Paramerers */
  1321.     X        flush_sf();
  1322.     X        return;
  1323.     X    default:
  1324.     X        fprintf(stderr, "unknown sf e9 type (x%02x)\n", sf_type);
  1325.     X        flush_sf();
  1326.     X        return;
  1327.     X    }
  1328.     X}
  1329. SHAR_EOF
  1330. if test 487 -ne "`wc -c < 'do_sfe9.c'`"
  1331. then
  1332.     echo shar: error transmitting "'do_sfe9.c'" '(should have been 487 characters)'
  1333. fi
  1334. chmod +x 'do_sfe9.c'
  1335. fi # end of overwriting check
  1336. echo shar: extracting "'do_single.c'" '(2069 characters)'
  1337. if test -f 'do_single.c'
  1338. then
  1339.     echo shar: will not over-write existing file "'do_single.c'"
  1340. else
  1341. sed 's/^    X//' << \SHAR_EOF > 'do_single.c'
  1342.     X#include "dca2troff.h"
  1343.     X
  1344.     X/* single byte control character */
  1345.     Xdo_single(c)
  1346.     Xint c;
  1347.     X{
  1348.     X    switch (c)
  1349.     X    {
  1350.     X    case 0x05:            /* "HT"        tab */
  1351.     X        in_fcr = 1;
  1352.     X        outstr("\t");
  1353.     X        return;
  1354.     X    case 0x33:            /* "IRT"    index return */
  1355.     X    case 0x06:            /* "RCR"    required carrier ret */
  1356.     X        outstr("\n.br\n");
  1357.     X        if(in_it != 0)
  1358.     X            outstr(".in 0\n");
  1359.     X        in_it == 0;            /* reset in_it */
  1360.     X        return;
  1361.     X    case 0x09:            /* "SPS"    superscript */
  1362.     X        outstr("\\u");            /* up half a line */
  1363.     X        return;
  1364.     X    case 0x0c:            /* "PE"        page end */
  1365.     X        outstr("\n");
  1366.     X        return;
  1367.     X    case 0x0d:            /* "ZICR"    zero index carrier
  1368.     X                            return */
  1369.     X        return;                /* go to pos 0 on current
  1370.     X                        line */
  1371.     X    case 0x15:            /* "CRE"    carrier return */
  1372.     X        if ( in_fcr == 1)
  1373.     X            outstr("\n.br\n");        /* forced cr */
  1374.     X        else
  1375.     X            outstr("\n");            /* just an eol */
  1376.     X        in_fcr = 0;                /* reset in_fcr */
  1377.     X        return;
  1378.     X    case 0x16:            /* "BS"        backspace */
  1379.     X        outstr("\b");
  1380.     X        return;
  1381.     X    case 0x1a:            /* "UBS"    unit backspace */
  1382.     X        outstr("\b");
  1383.     X        return;
  1384.     X    case 0x23:            /* "WUS"    word underscore */
  1385.     X                        /* back to last word break */
  1386.     X        printf("\\fI");            /* start the underscore */
  1387.     X        outachar('\177');        /* flush last word */
  1388.     X        printf("\\fR");            /* back to roman */
  1389.     X        return;
  1390.     X    case 0x25:            /* "INX"    index */
  1391.     X        return;                /* line feed? */
  1392.     X    case 0x36:            /* "NBS"    numeric backspace */
  1393.     X        outstr("\\h'-\\w'1'u'");
  1394.     X        return;
  1395.     X    case 0x38:            /* "SBS"    subscript */
  1396.     X        outstr("\\d");            /* down half a line */
  1397.     X        return;
  1398.     X    case 0x39:            /* "IT"        indent tab */
  1399.     X        in_fcr = 1;
  1400.     X        in_it = 1;
  1401.     X        outstr("\n'in+.5i\n");        /* move indent plus a stop */
  1402.     X        return;
  1403.     X    case 0x3a:            /* "RPE"    required page end */
  1404.     X        outstr("\n.bp\n");
  1405.     X        return;
  1406.     X    case 0x3f:            /* "SUB"    substitute */
  1407.     X        outstr("_");            /* inserted in place of err */
  1408.     X        return;
  1409.     X    case 0x40:            /* "SP"        space */
  1410.     X    case 0x41:
  1411.     X        outstr(" ");        /* "RSP"    required space */
  1412.     X        return;
  1413.     X    case 0x60:            /* "HYP"    required hyphen */
  1414.     X        outstr("-");
  1415.     X        return;
  1416.     X    case 0xca:            /* "SHY"    syllable hyphen */
  1417.     X        return;
  1418.     X    case 0xe1:            /* "NSP"    numeric space */
  1419.     X        outstr("\\h'\\w'1'u'");
  1420.     X        return;
  1421.     X    default:
  1422.     X        fprintf(stderr, "unknown single char code (x%02x)\n", c);
  1423.     X        exit(1);;
  1424.     X    }
  1425.     X}
  1426. SHAR_EOF
  1427. if test 2069 -ne "`wc -c < 'do_single.c'`"
  1428. then
  1429.     echo shar: error transmitting "'do_single.c'" '(should have been 2069 characters)'
  1430. fi
  1431. chmod +x 'do_single.c'
  1432. fi # end of overwriting check
  1433. echo shar: extracting "'do_spchar.c'" '(1543 characters)'
  1434. if test -f 'do_spchar.c'
  1435. then
  1436.     echo shar: will not over-write existing file "'do_spchar.c'"
  1437. else
  1438. sed 's/^    X//' << \SHAR_EOF > 'do_spchar.c'
  1439.     X
  1440.     X/* special characters, not normally in troff */
  1441.     X/* should be read in from a file for each device/font */
  1442.     X/* we will output the 3rd field in the struct as a troff comment line */
  1443.     X/* if the 2nd field is null */
  1444.     X
  1445.     Xstruct spc {
  1446.     X    int spcode;            /* dca code for character */
  1447.     X    char *spstr;            /* titroff code for char on imagen */
  1448.     X    char *explan;            /* what is the char ? */
  1449.     X} spchar[] = {
  1450.     X        0x59, "\\(ss",        "german sharp s",
  1451.     X        0x70, "\\(O/",        "O slash",
  1452.     X        0x8a, "",        "European open quote",
  1453.     X        0x8b, "",        "European close quote",
  1454.     X        0x8c, "",        "d stroke",
  1455.     X        0x8e, "",        "small letter thorn",
  1456.     X        0x9f, "",        "international currency sym",
  1457.     X        0xa0, "",        "Micro",
  1458.     X        0xaa, "\\(!!",        "inverted !",
  1459.     X        0xab, "\\(??",        "inverted ?",
  1460.     X        0xac, "",        "D stroke",
  1461.     X        0xae, "",        "Capital Thorn",
  1462.     X        0xb1, "",        "Pound sign",
  1463.     X        0xb2, "",        "Yen",
  1464.     X        0xb3, "",        "Peseta",
  1465.     X        0xb4, "",        "Floren, Guilder",
  1466.     X        0xb6, "\\(pa",        "paragraph sign",
  1467.     X        0xbc, "\\(mc",        "overbar",
  1468.     X        0xbd, "\\(..",        "diaeresis",
  1469.     X        0xbf, "",        "double underscore",
  1470.     X        0xda, "\\(ui",        "dotless i",
  1471.     X        0xea, "\\u\\s-22\\s+2\\d",    "superscript 2",
  1472.     X        0xfa, "\\u\\s-23\\s+2\\d",    "superscript 3",
  1473.     X        0xff, "",        "Eight Ones",
  1474.     X        0x00, "",        ""
  1475.     X};
  1476.     X
  1477.     X#include "dca2troff.h"
  1478.     X
  1479.     Xdo_spchar(ch)
  1480.     Xchar ch;
  1481.     X{
  1482.     X    int i;
  1483.     X    for(i=0; spchar[i].spcode != ch; i++)
  1484.     X        {
  1485.     X        if (spchar[i].spcode == 0)
  1486.     X            {
  1487.     X            fprintf(stderr, "error: unknown special char 0X%02x\n", ch);
  1488.     X            return(0);
  1489.     X            }
  1490.     X        }
  1491.     X    if(strcmp(spchar[i].spstr, "") == 0)
  1492.     X        {
  1493.     X        sprintf(tline, "\\\" %s\n", spchar[i].explan);
  1494.     X        outstr(tline);
  1495.     X        }
  1496.     X    else
  1497.     X        outstr(spchar[i].spstr);
  1498.     X    return(0);
  1499.     X}
  1500. SHAR_EOF
  1501. if test 1543 -ne "`wc -c < 'do_spchar.c'`"
  1502. then
  1503.     echo shar: error transmitting "'do_spchar.c'" '(should have been 1543 characters)'
  1504. fi
  1505. chmod +x 'do_spchar.c'
  1506. fi # end of overwriting check
  1507. echo shar: extracting "'do_text.c'" '(701 characters)'
  1508. if test -f 'do_text.c'
  1509. then
  1510.     echo shar: will not over-write existing file "'do_text.c'"
  1511. else
  1512. sed 's/^    X//' << \SHAR_EOF > 'do_text.c'
  1513.     X#include "dca2troff.h"
  1514.     X#include "ebtab.h"
  1515.     X
  1516.     X/* text block */
  1517.     Xdo_text()
  1518.     X{
  1519.     X    int c;
  1520.     X    for ( ;; )
  1521.     X    {
  1522.     X    if ( sf_incnt >= sf_length )
  1523.     X        return;
  1524.     X    c = get1ch();
  1525.     X    c &= 0377;
  1526.     X    switch (ebaray[c].type)
  1527.     X        {
  1528.     X        case 0:        /* forget it */
  1529.     X        break;
  1530.     X        case 1:        /* simple character string */
  1531.     X        outstr(ebaray[c].arg);
  1532.     X        break;
  1533.     X        case 2:        /* single character control */
  1534.     X        do_single(c);
  1535.     X        break;
  1536.     X        case 3:        /* multibyte control */
  1537.     X        do_multi();
  1538.     X        break;
  1539.     X        case 4:        /* accented character */
  1540.     X        do_accent(ebaray[c].arg);
  1541.     X        break;
  1542.     X        case 5:        /* troff special character */
  1543.     X        outstr(ebaray[c].arg);
  1544.     X        break;
  1545.     X        case 6:        /* non-troff special character */
  1546.     X        do_spchar(ebaray[c].arg);
  1547.     X        break;
  1548.     X    
  1549.     X        }
  1550.     X    }
  1551.     X}
  1552. SHAR_EOF
  1553. if test 701 -ne "`wc -c < 'do_text.c'`"
  1554. then
  1555.     echo shar: error transmitting "'do_text.c'" '(should have been 701 characters)'
  1556. fi
  1557. chmod +x 'do_text.c'
  1558. fi # end of overwriting check
  1559. echo shar: extracting "'externs.c'" '(1064 characters)'
  1560. if test -f 'externs.c'
  1561. then
  1562.     echo shar: will not over-write existing file "'externs.c'"
  1563. else
  1564. sed 's/^    X//' << \SHAR_EOF > 'externs.c'
  1565.     X
  1566.     Xint in_fcr = 0;        /* if CRE and in_fcr, then required return */
  1567.     Xint in_it = 0;        /* in an indent tab */
  1568.     X
  1569.     Xint sf_length = 0;    /* length of structured field */
  1570.     Xint sf_class = 0;    /* class of structured field */
  1571.     Xint sf_type = 0;    /* type of structured field */
  1572.     Xint sf_format = 0;    /* format of structured field */
  1573.     X
  1574.     Xint mb_class = 0;    /* class of a multi byte command */
  1575.     Xint mb_count = 0;    /* size of a multi byte command */
  1576.     Xint mb_type = 0;    /* type of a multi byte command */
  1577.     X
  1578.     Xint blpt = 0;        /* pointer to output buffer */
  1579.     Xchar bufline[255];     /* output buffer */
  1580.     X
  1581.     Xint sf_incnt = 0;    /* how many characters have we read in this sf */
  1582.     X
  1583.     Xchar ctemp;        /* some temp regs */
  1584.     Xchar dtemp;        /* some temp regs */
  1585.     Xchar etemp;        /* some temp regs */
  1586.     Xchar ftemp;        /* some temp regs */
  1587.     Xchar gtemp;        /* some temp regs */
  1588.     Xchar htemp;        /* some temp regs */
  1589.     X
  1590.     Xint itemp;        /* some temp regs */
  1591.     Xint jtemp;        /* some temp regs */
  1592.     Xint ktemp;        /* some temp regs */
  1593.     Xint ltemp;        /* some temp regs */
  1594.     Xint mtemp;        /* some temp regs */
  1595.     Xint ntemp;        /* some temp regs */
  1596.     X
  1597.     Xchar tline[255];    /* a temp buffer */
  1598. SHAR_EOF
  1599. if test 1064 -ne "`wc -c < 'externs.c'`"
  1600. then
  1601.     echo shar: error transmitting "'externs.c'" '(should have been 1064 characters)'
  1602. fi
  1603. chmod +x 'externs.c'
  1604. fi # end of overwriting check
  1605. echo shar: extracting "'getopt.c'" '(1437 characters)'
  1606. if test -f 'getopt.c'
  1607. then
  1608.     echo shar: will not over-write existing file "'getopt.c'"
  1609. else
  1610. sed 's/^    X//' << \SHAR_EOF > 'getopt.c'
  1611.     X/* got this off net.sources */
  1612.     X#include <stdio.h>
  1613.     X
  1614.     X/*
  1615.     X * get option letter from argument vector
  1616.     X */
  1617.     Xint    opterr = 1,        /* useless, never set or used */
  1618.     X    optind = 1,        /* index into parent argv vector */
  1619.     X    optopt;            /* character checked for validity */
  1620.     Xchar    *optarg;        /* argument associated with option */
  1621.     X
  1622.     X#define BADCH    (int)'?'
  1623.     X#define EMSG    ""
  1624.     X#define tell(s)    fputs(*nargv,stderr);fputs(s,stderr); \
  1625.     X        fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);
  1626.     X
  1627.     Xgetopt(nargc,nargv,ostr)
  1628.     Xint    nargc;
  1629.     Xchar    **nargv,
  1630.     X    *ostr;
  1631.     X{
  1632.     X    static char    *place = EMSG;    /* option letter processing */
  1633.     X    register char    *oli;        /* option letter list index */
  1634.     X    char    *index();
  1635.     X
  1636.     X    if(!*place) {            /* update scanning pointer */
  1637.     X        if(optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) return(EOF);
  1638.     X        if (*place == '-') {    /* found "--" */
  1639.     X            ++optind;
  1640.     X            return(EOF);
  1641.     X        }
  1642.     X    }                /* option letter okay? */
  1643.     X    if ((optopt = (int)*place++) == (int)':' || !(oli = index(ostr,optopt))) {
  1644.     X        if(!*place) ++optind;
  1645.     X        tell(": illegal option -- ");
  1646.     X    }
  1647.     X    if (*++oli != ':') {        /* don't need argument */
  1648.     X        optarg = NULL;
  1649.     X        if (!*place) ++optind;
  1650.     X    }
  1651.     X    else {                /* need an argument */
  1652.     X        if (*place) optarg = place;    /* no white space */
  1653.     X        else if (nargc <= ++optind) {    /* no arg */
  1654.     X            place = EMSG;
  1655.     X            tell(": option requires an argument -- ");
  1656.     X        }
  1657.     X         else optarg = nargv[optind];    /* white space */
  1658.     X        place = EMSG;
  1659.     X        ++optind;
  1660.     X    }
  1661.     X    return(optopt);            /* dump back option letter */
  1662.     X}
  1663. SHAR_EOF
  1664. if test 1437 -ne "`wc -c < 'getopt.c'`"
  1665. then
  1666.     echo shar: error transmitting "'getopt.c'" '(should have been 1437 characters)'
  1667. fi
  1668. chmod +x 'getopt.c'
  1669. fi # end of overwriting check
  1670. echo shar: extracting "'misc.c'" '(575 characters)'
  1671. if test -f 'misc.c'
  1672. then
  1673.     echo shar: will not over-write existing file "'misc.c'"
  1674. else
  1675. sed 's/^    X//' << \SHAR_EOF > 'misc.c'
  1676.     X#include "dca2troff.h"
  1677.     X
  1678.     X
  1679.     Xdo_flush(count)
  1680.     Xint count;
  1681.     X{
  1682.     X    char c;
  1683.     X    if ( count == 0 )
  1684.     X    return;
  1685.     X    while ( count > 0 )
  1686.     X    {
  1687.     X    c = get1ch();
  1688.     X    --count;
  1689.     X    }
  1690.     X}
  1691.     X
  1692.     X/* flush a structured field */
  1693.     Xflush_sf()
  1694.     X{
  1695.     X    do_flush(sf_length - sf_incnt);
  1696.     X}
  1697.     X
  1698.     X/* get a char from stdin, increment the sf count */
  1699.     Xget1ch()
  1700.     X{
  1701.     X    ++sf_incnt;
  1702.     X    return (getchar());
  1703.     X}
  1704.     X
  1705.     X/* get a 2 byte number from the input */
  1706.     Xget1num()
  1707.     X{
  1708.     X    int c, num;
  1709.     X    c = get1ch();        /* get 1st byte of length */
  1710.     X    if ( c == EOF )
  1711.     X        exit(0);    /* all done */
  1712.     X    c &= 0377;
  1713.     X    num = c << 8;
  1714.     X    c = get1ch();
  1715.     X    c &= 0377;
  1716.     X    num = num + c;
  1717.     X    return(num);
  1718.     X}
  1719. SHAR_EOF
  1720. if test 575 -ne "`wc -c < 'misc.c'`"
  1721. then
  1722.     echo shar: error transmitting "'misc.c'" '(should have been 575 characters)'
  1723. fi
  1724. chmod +x 'misc.c'
  1725. fi # end of overwriting check
  1726. echo shar: extracting "'outachar.c'" '(818 characters)'
  1727. if test -f 'outachar.c'
  1728. then
  1729.     echo shar: will not over-write existing file "'outachar.c'"
  1730. else
  1731. sed 's/^    X//' << \SHAR_EOF > 'outachar.c'
  1732.     X#include "dca2troff.h"
  1733.     X
  1734.     X/* output a char to a buffer */
  1735.     X/*  so that the "underline previous word" will work */
  1736.     X/*  buffer flushed on seeing white space */
  1737.     X
  1738.     Xoutachar(c)
  1739.     Xchar c;
  1740.     X{
  1741.     X    int ic;
  1742.     X    ic = c;
  1743.     X    ic &= 0177;
  1744.     X    switch(ic)
  1745.     X        {
  1746.     X        case ' ':
  1747.     X        case '\n':
  1748.     X        case '\t':            /* flush buffer and new character */
  1749.     X        printf("%s", bufline);
  1750.     X        blpt = 0;
  1751.     X        bufline[blpt] = NULL;
  1752.     X        printf("%c", c);
  1753.     X        return;
  1754.     X        case '\177':        /* flush buffer but don't dump char */
  1755.     X        printf("%s", bufline);
  1756.     X        blpt = 0;
  1757.     X        bufline[blpt] = NULL;
  1758.     X        return;
  1759.     X        case NULL:
  1760.     X        return;            /* jic */
  1761.     X        default:            /* store the character */
  1762.     X        bufline[blpt++] = c;
  1763.     X        bufline[blpt] = NULL;
  1764.     X        return;
  1765.     X        }
  1766.     X}
  1767.     X
  1768.     Xoutstr(c)
  1769.     Xchar *c;
  1770.     X{
  1771.     X    char ic;
  1772.     X    if ( *c == NULL )
  1773.     X        return;
  1774.     X    for (; *c != NULL; *c++)
  1775.     X        {
  1776.     X        ic = *c;
  1777.     X        outachar(ic);
  1778.     X        }
  1779.     X}
  1780. SHAR_EOF
  1781. if test 818 -ne "`wc -c < 'outachar.c'`"
  1782. then
  1783.     echo shar: error transmitting "'outachar.c'" '(should have been 818 characters)'
  1784. fi
  1785. chmod +x 'outachar.c'
  1786. fi # end of overwriting check
  1787. echo shar: extracting "'opts'" '(499 characters)'
  1788. if test -f 'opts'
  1789. then
  1790.     echo shar: will not over-write existing file "'opts'"
  1791. else
  1792. sed 's/^    X//' << \SHAR_EOF > 'opts'
  1793.     Xdca2troff [ -mm -me -ms -man ] [ -ff fontmap_file ] [ -af accent_file ] [ -d# ] [ infile ... ] 
  1794.     X
  1795.     X-mm, -me, -ms, -man
  1796.     X look for file /usr/local/lib/dca2.xx ( where xx is the macro pkg )
  1797.     X in there are function to macro name mappings
  1798.     X
  1799.     Xformat of fontmap_file
  1800.     X
  1801.     Xibm# <TAB> troff_font_name
  1802.     X
  1803.     Xformat of accent_file
  1804.     X
  1805.     Xhex code <TAB> troff_string to use
  1806.     X
  1807.     Xdebug levels: hex character
  1808.     X
  1809.     Xbit 0    - list font changes
  1810.     Xbit 1    - list sf commands
  1811.     Xbit 2    - list mb commands
  1812.     Xbit 3    - list single byte commands
  1813.     X
  1814.     Xadd page setups
  1815. SHAR_EOF
  1816. if test 499 -ne "`wc -c < 'opts'`"
  1817. then
  1818.     echo shar: error transmitting "'opts'" '(should have been 499 characters)'
  1819. fi
  1820. chmod +x 'opts'
  1821. fi # end of overwriting check
  1822. #    End of shell archive
  1823. exit 0
  1824.